import { Select } from 'antd';

const { Option } = Select;

interface OptionsItem {
  title: string;
  key: string;
}

interface Props {
  options: OptionsItem[];
  onChange: () => {};
}

const BaseSelect = ({ options, onChange }: Props) => {
  // console.log(options);
  return (
    <Select placeholder="请选择" onChange={onChange}>
      {options.map((item: OptionsItem) => {
        return (
          <Option key={item.key} value={item.key}>
            {item.title}
          </Option>
        );
      })}
    </Select>
  );
};

export default BaseSelect;
